<?php

    namespace yaliSDK\common;

    // 单例模式，服务管理类
    use think\Db;
    use yaliSDK\customer\CompanyStaffRepository;
    use yaliSDK\customer\CompanyStaffService;
    use yaliSDK\customer\CustomerRepository;
    use yaliSDK\customer\CustomerService;
    use yaliSDK\customer\ExchangerStaffRepository;
    use yaliSDK\db\IDB;
    use yaliSDK\db\RedisDB;
    use yaliSDK\medal\MedalRepository;
    use yaliSDK\medal\MedalService;
    use yaliSDK\award\AwardService;
    use yaliSDK\award\AwardRepository;
    use yaliSDK\mns\OrderMNSService;
    use yaliSDK\mns\TicketStockMNSService;
    use yaliSDK\mns\OrderPaymentMNSService;
    use yaliSDK\ticket\ExchangeRepository;
    use yaliSDK\ticket\MysqlExchangeService;
    use yaliSDK\ticket\TicketRepository;
    use yaliSDK\order\{
        OrderService
    };
    use yaliSDK\ticket\TicketService;
    use yaliSDK\ticket\TransactionService;
    use yaliSDK\admin\AdminService;
    use yaliSDK\sms\{
        SmsService, SmsRepository
    };
    use yaliSDK\tramp\TramperRepository;
    use yaliSDK\oss\QrcodeOssService;

    class ServiceManager {
        static private $instance;

        public function __construct($db = null) {

        }


        public function closeAllDb() {
//            if ($this->db) {
//                $this->db->getHandler()->close();
//                $this->db = null;
//            }
//            if ($this->db2) {
//                $this->db2->getHandler()->close();
//                $this->db2 = null;
//            }
//            $this->getOrderService()->closeDb();
            Db::clear();
        }
    }